//2009/08/19 17:18:31
#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <sstream>
#include <algorithm>

using namespace std;

class PackingParts
{
public:
    int pack(vector <int> part, vector <int> box)
    {
        multiset<int> m;
        for (int i=0; i<box.size(); i++) m.insert(box[i]);
        int total = 0;
        for (int i=0; i<part.size(); i++)
            if (m.lower_bound(part[i]) != m.end())
            {
                m.erase(m.lower_bound(part[i]));
                total ++;
            }
        return total;
    }
};
